home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-09-03 | 6.8 KB | 151 lines | [TEXT/MPS ] |
- #
- # File: BuildUSBMenu
- #
- # Contains: xxx put contents here xxx
- #
- # Version: xxx put version here xxx
- #
- # Copyright: © 1997-1998 by Apple Computer, Inc., all rights reserved.
- #
-
- set echo 0
-
- Set -e USBDDKObjects "{USBDDKFolder}Objects:";
- Set -e USBDDKTargets "{USBDDKFolder}Targets:";
- Set -e USBDDKReleaseExtensions "{USBDDKFolder}Extensions-DDKBuilt:";
- Set -e USBDDKMapDir "{USBDDKFolder}Targets:Maps:"
-
- Set -e USBDDKDrivers "{USBDDKFolder}Drivers:";
- Set -e USBDDKExamples "{USBDDKFolder}Examples:";
- Set -e USBDDKInterfaces "{USBDDKFolder}Interfaces:";
- Set -e USBDDKRIncludes "{USBDDKFolder}Interfaces:";
- Set -e USBDDKLibraries "{USBDDKFolder}Libraries:";
-
- Set -e USBDDKInterfacesExternal "{CIncludes}";
- Set -e USBDDKInterfacesInternal "{USBDDKFolder}Interfaces:";
-
- # •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- # Add the USBDDK menu with its associated items.
- Set USBDDKProjectMenuName USBDDK; # USBDDK is the name of the menu
-
- DeleteMenu "{USBDDKProjectMenuName}" ∑ dev:null || Echo ∑ dev:null
-
-
- # ••••• Set Build mode (Engineering or SCM):
- #
- Alias SetBuildMenus 'If {USBDDKEngrBuild} ; ∂
- AddMenu "USBDDK" "Engineering Build!√" "Set -e USBDDKEngrBuild 1; SetBuildMenus" ; ∂
- AddMenu "USBDDK" "SCM Build" "Set -e USBDDKEngrBuild 0 ; SetBuildMenus" ; ∂
- Else; ∂
- Set -e USBDDKSymbols "-sym off"; ∂
- Set -e USBDDKMBGSymbols "-mbg off"; ∂
- Set -e USBDDKDebugFlag 0; ∂
- Set -e DebugBuild 0; ∂
- AddMenu "USBDDK" "Engineering Build" "Set -e USBDDKEngrBuild 1; SetBuildMenus" ; ∂
- AddMenu "USBDDK" "SCM Build!√" "Set -e USBDDKEngrBuild 0; SetBuildMenus" ; ∂
- End;'
-
- SetBuildMenus;
-
- AddMenu "{USBDDKProjectMenuName}" '(-' ''
-
- # ••••• Does the basic build.
- #
- AddMenu "{USBDDKProjectMenuName}" 'Build Driver or Example/ç' 'Open "{Worksheet}"; "{USBDDKToolsFolder}"USBDDKBuildDriver ∑∑ "{Worksheet}"'
-
-
- # ••••• Does the basic full build by specifying the -e delimeter to the make function.
- # Warning! This is dangerous because if a source file fails to assemble/compile, there still might be a corresponding
- # old object file hanging around which would get linked in as if there was no problem... - DMS
- # AddMenu "{USBDDKProjectMenuName}" 'Full Build Driver or Example/ƒ' 'Open "{Worksheet}"; "{USBDDKToolsFolder}"USBDDKBuildDriver full ∑∑ "{Worksheet}"'
-
-
- # ••••• Deletes all the objects of the current driver as per its makefile - then does a full rebuild.
- #
- AddMenu "{USBDDKProjectMenuName}" 'Clean & Rebuild Driver or Example…' 'Open "{Worksheet}"; ∂
- Confirm "Delete object files and rebuild?" || (Beep; Exit); ∂
- "{USBDDKToolsFolder}"USBDDKBuildDriver clean ∑∑ "{Worksheet}"'
-
- # ••••• Toggles the USBDDKSymbols variable to turn debugger symbols on or off
- #
- AddMenu "{USBDDKProjectMenuName}" 'Debug Symbols & Flags…' 'if "{USBDDKSymbols}" == "-sym on"; ∂
- Confirm "Symbols and Flags are currently on. Turn all symbols off?" || (Beep; Exit); ∂
- Set -e USBDDKSymbols "-sym off"; ∂
- Set -e USBDDKMBGSymbols "-mbg off"; ∂
- Set -e USBDDKDebugFlag 0; ∂
- Set -e DebugBuild 0; ∂
- Else; ∂
- Confirm "Symbols and Flags are currently off. Turn all symbols on?" || (Beep; Exit); ∂
- Set -e USBDDKSymbols "-sym on"; ∂
- Set -e USBDDKMBGSymbols "-mbg on"; ∂
- Set -e USBDDKDebugFlag 1; ∂
- Set -e DebugBuild 1; ∂
- End; ∂
- Echo "# USBDDKSymbols = "{USBDDKSymbols} ∑∑ "{Worksheet}"; ∂
- Echo "# USBDDKMBGSymbols = "{USBDDKMBGSymbols} ∑∑ "{Worksheet}"; ∂
- Echo "# USBDDKDebugFlag = "{USBDDKDebugFlag} ∑∑ "{Worksheet}"; ';
-
-
-
- AddMenu "{USBDDKProjectMenuName}" "(-" "";
-
-
- # ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- # This for loop puts all of the drivers directories in the USBDDK menu.
- # When the driver name is selected in the menu, the current directory is set to where that folder currently exists.
- # The UserStartup script is executed again to get the proper menu un-checked and checked.
- #
- #echo "Add select driver"
- set foldersfound 0
- AddMenu "{USBDDKProjectMenuName}" 'Select Driver in DriverSrc Folder' '';
- if `Exists "{USBDDKFolder}DriverSrc"`
- For i In `Files -af -f -d "{USBDDKFolder}DriverSrc"` # For all directories in Sources folder....
- (Evaluate "{i}" =~ /≈':'≈':'(≈)®1':'/) ∑ dev:null # Get the name of the folder, put in ®1
- Set char '' # else make sure there is no checkmark.
- AddMenu "DDKDriverList" "{®1}{char}" "(Directory ∂"{i}∂") ∑∑ ∂""{Worksheet}"∂" ; set -e USBDDKDriverPath {i}; set -e USBDDKDriver {®1}";
- set foldersfound '1'
- End
- if {foldersfound} == '1'
- AddMenu -link "{USBDDKProjectMenuName}" 'Select Driver in DriverSrc Folder' 'DDKDriverList';
- End
- End
-
- #echo "Add select example"
- set foldersfound 0
- AddMenu "{USBDDKProjectMenuName}" 'Select Example' '';
- if `Exists "{USBDDKFolder}Examples"`
- For i In `Files -af -f -d "{USBDDKFolder}Examples"` # For all directories in Examples folder....
- (Evaluate "{i}" =~ /≈':'≈':'(≈)®1':'/) ∑ dev:null # Get the name of the folder, put in ®1
- Set char '' # else make sure there is no checkmark.
- AddMenu "ExampleList" "{®1}{char}" "(Directory ∂"{i}∂") ∑∑ ∂""{Worksheet}"∂" ; set -e USBDDKDriverPath {i}; set -e USBDDKDriver {®1}";
- set foldersfound '1'
- End
- if {foldersfound} == '1'
- AddMenu -link "{USBDDKProjectMenuName}" 'Select Example' 'ExampleList';
- End
- End
-
- #echo "Add create driver menu item"
- AddMenu "{USBDDKProjectMenuName}" '(-' '';
- AddMenu "{USBDDKProjectMenuName}" 'Create New Driver in DriverSrc folder…' 'Open "{Worksheet}"; ∂
- Set NewDriverName "`(Request "What is the name of the new driver?")≥dev:null`"; ∂
- if ¬ `Exists "{USBDDKFolder}DriverSrc:""{NewDriverName}"`; ∂
- NewFolder "{USBDDKFolder}DriverSrc:""{NewDriverName}"; ∂
- End; ∂
- Execute "{USBDDKToolsFolder}USBDDKMPWMenu"; '
-
- #echo "Add build menu items"
- AddMenu "{USBDDKProjectMenuName}" '(-' '';
- AddMenu "{USBDDKProjectMenuName}" 'Build All USB Drivers and examples…' 'Open "{Worksheet}"; ∂
- directory "{USBDDKFolder}{USBDDKLocalFolder}"; ∂
- "{USBDDKToolsFolder}"USBDDKBuildAll ∑∑ "{Worksheet}";'
-
- AddMenu "{USBDDKProjectMenuName}" 'Clean & Build All USB Drivers and examples…' 'Open "{Worksheet}"; ∂
- directory "{USBDDKFolder}{USBDDKLocalFolder}"; ∂
- "{USBDDKToolsFolder}"USBDDKBuildAll clean ∑∑ "{Worksheet}";'
-
- AddMenu "{USBDDKProjectMenuName}" 'Full Build All USB Drivers and examples…' 'Open "{Worksheet}"; ∂
- Confirm "FULL Build of all USB Drivers?∂n" || (Beep; Exit); ∂
- directory "{USBDDKFolder}{USBDDKLocalFolder}"; ∂
- "{USBDDKToolsFolder}"USBDDKBuildAll full ∑∑ "{Worksheet}";'
-